#include <bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch))f^=(ch=='-'),ch=getchar();
	while(isdigit(ch))x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return f?x:-x;
}
int n,T;
const int N=30;
int a[N*2],flg;
int ans[N*100],hd,tl;
int check(int st){
	int head=n*50,tail=head-1;
	hd=1,tl=n;
	for(int i=1;i<=n;i++){
		int op=(st>>i-1)&1;
		if(op==0)ans[--head]=a[hd++];
		else ans[++tail]=a[tl--];
	}
	for(int i=1;i<=n;i++){
		int opt=n-i+1;
		if(ans[i+head-1]!=ans[opt+head-1])return 0;
	}
	return 1;
}
void out(int st){
		for(int i=1;i<=n;i++){
			int op=(st>>i-1)&1;
			if(op==0)cout<<'L';
			else cout<<'R';
		}
		cout<<endl;
		flg=1;return;
}
void dfs(int i,int st){
	if(flg==1)return;
	if(i==n+1){
		if(check(st)){
			out(st);
		}
	}
	else{
	dfs(i+1,st<<1);dfs(i+1,st<<1|1);}
}
signed main(){
	freopen("palin.in","r",stdin);
	freopen("palin.out","w",stdout);
	T=read();
	while(T--){
		flg=0;
		n=read()*2;
		for(int i=1;i<=n;i++){
			a[i]=read();
		}
		dfs(1,0);
		if(flg==0)cout<<-1<<endl;
	}
}
